ManagedLibraryExpressionID
ManagedLibraryExpressionID[expr] returns the positive integer ID associated with expr if it is a managed library expression and $Failed otherwise.
ManagedLibraryExpressionID[expr,mname] only returns the ID if expr is associated with the registered manager having name mname.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.